package br.com.cfccultura.admin.view.tag.combo;

import java.util.List;

import javax.servlet.jsp.JspException;

import org.springframework.stereotype.Component;

import br.com.cfccultura.admin.model.dao.IFuncionarioDAO;
import br.com.cfccultura.admin.model.enums.TipoFuncionario;
import br.com.cfccultura.admin.model.vo.Funcionario;

@Component
public class ComboInstrutorTag extends DefaultComboTag {
	
	private static final long serialVersionUID = 1073435506129686702L;
	
	@Override
	public int doStartTagInternal() throws JspException {
		
		IFuncionarioDAO dao = getBean(IFuncionarioDAO.class);

		List<Funcionario> list = dao.consultar(new Funcionario(TipoFuncionario.INSTRUTOR));
		buildCombo(list, "nome", "codigo");
		
		return SKIP_BODY;
	}
}
